echo off
path = "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\"
echo Deleting old solution
stsadm.exe -o deletesolution -name "CKS.EnhancedContentQueryWebPart.wsp" -override
echo Adding solution
stsadm.exe  -o addsolution -filename "CKS.EnhancedContentQueryWebPart.wsp"
echo Deploying solution
stsadm.exe -o deploysolution -name "CKS.EnhancedContentQueryWebPart.wsp" -allcontenturls -immediate -allowgacdeployment -force
echo Running timer jobs to finish deployment
stsadm.exe -o  execadmsvcjobs

echo Do you want to activate the Enhanced Content Query Web Part feature to a specific site now? (Y/N)
CHOICE /C:YN<- /N < NUL
IF ERRORLEVEL 3 GOTO END
IF ERRORLEVEL 2 GOTO END
Echo Please enter the url to the site collection to which you want to activate the feature to:
set /p SitePath=
stsadm.exe -o activatefeature -name "CKS.EnhancedContentQueryWebPart" -url %SitePath% -force 
:END
echo CKS.EnhancedContentQueryWebPart Solution installed.
